#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
int main()
{
	int i,j;
	int x=10;
	int y=8; 
	char input;
	int isfired = 0;
	int ny = 5;
	int iskilled = 0;
	int t=0 ,sum=0;

	while ( 1 )
	{
		system("cls");


		if ( iskilled == 0 )
		{
			for ( i=0; i<=ny; i++ )
					printf(" ");
			printf("+\n");
			t = 0;

		}

		if ( iskilled == 1 )
		{
			for ( i=0; i<=ny; i++ )
					printf(" ");
			t = 1;
		}

		if ( t == 1 )
		{
			iskilled = 0;
			sum++;
		}

		if ( isfired == 0 )
		{
			for ( i=0; i<=x; i++ )
				printf("\n");
		}
		
		else
		{	
			for ( i=0; i<=x; i++ )
			{
				for ( j=0; j<=y; j++ )
					printf(" ");
				printf("  |\n");
			}
			isfired = 0;
			
			if ( y+2 == ny )
				iskilled = 1;
		}

		for ( j=0; j<=y; j++ )
			printf(" ");
		printf("  *\n");

		for ( j=0; j<=y; j++ )
			printf(" ");
		printf("*****\n");


		for ( j=0; j<=y; j++ )
			printf(" ");
		printf(" * *\n");

		for ( j=0; j<=y; j++ )
			printf(" ");
		printf("%d",sum);

		input = getch();

		if ( input == 'w' )
			x--;
		if ( input == 's' )
			x++;
		if ( input == 'a' )
			y--;
		if ( input == 'd' )
			y++;
		if ( input == ' ' )
			isfired = 1;

	}
	
	


	return 0;
}
